package de.openlaboratory.elib.view;

import java.util.HashSet;
import java.util.Hashtable;
import java.util.Map;
import java.util.Set;

public class ViewConfiguration
{
	private String page;
	private String title;
	private String mainPage;
	private String menu;
	Set<String> styleSheets;
	Set<String> javaScripts;
	Map<String, String> menuItems;

	public Map<String, String> getMenuItems()
	{
		return menuItems;
	}

	public void setMenuItems(String page)
	{
		menuItems = new Hashtable<String, String>();

		menuItems.put("publication", "Publications");
		menuItems.put("library", "Library");
		menuItems.put("file", "Files");
	}

	public String getMainPage()
	{
		return mainPage;
	}

	public void setMainPage(String mainPage)
	{
		this.mainPage = mainPage;
	}

	public String getPage()
	{
		return page;
	}

	public void setPage(String page)
	{
		this.page = page;
	}

	public String getMenu()
	{
		return menu;
	}

	public void setMenu(String menu)
	{
		this.menu = menu;
	}

	public Set<String> getStyleSheets()
	{
		return styleSheets;
	}

	public void setStyleSheets(Set<String> styles)
	{
		styleSheets = new HashSet<String>();
		
		styleSheets.add("css/elib-desktop.css");
		styleSheets.add("css/elib-message.css");
	}

	public void addStyleSheets(String style)
	{
		if(styleSheets == null)
		{
			styleSheets = new HashSet<String>();
		}

		styleSheets.add("css/" + style);
	}
	
	public void setMenuItems(Map<String, String> menuItems)
	{
		this.menuItems = menuItems;
	}

	public String getTitle()
	{
		return title;
	}

	public void setTitle(String title)
	{
		this.title = title;
	}

	public void setJavaScripts(String js)
	{
		if(javaScripts == null)
		{
			javaScripts = new HashSet<String>();
		}

		javaScripts.add("js/".concat(js));
	}

	public Set<String> getJavaScripts()
	{
		return javaScripts;
	}
}
